package com.ruoyi.oa.service.impl;

import java.util.List;

import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.oa.mapper.OaConfirmMapper;
import com.ruoyi.oa.domain.OaConfirm;
import com.ruoyi.oa.service.IOaConfirmService;

/**
 * 审核Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-10-31
 */
@Service
public class OaConfirmServiceImpl implements IOaConfirmService 
{
    @Autowired
    private OaConfirmMapper oaConfirmMapper;

    /**
     * 查询审核
     * 
     * @param confirmUuid 审核主键
     * @return 审核
     */
    @Override
    public OaConfirm selectOaConfirmByConfirmUuid(String confirmUuid)
    {
        return oaConfirmMapper.selectOaConfirmByConfirmUuid(confirmUuid);
    }

    /**
     * 查询审核列表
     * 
     * @param oaConfirm 审核
     * @return 审核
     */
    @Override
    public List<OaConfirm> selectOaConfirmList(OaConfirm oaConfirm)
    {
        return oaConfirmMapper.selectOaConfirmList(oaConfirm);
    }

    /**
     * 新增审核
     * 
     * @param oaConfirm 审核
     * @return 结果
     */
    @Override
    public int insertOaConfirm(OaConfirm oaConfirm)
    {
        return oaConfirmMapper.insertOaConfirm(oaConfirm);
    }

    /**
     * 修改审核
     * 
     * @param oaConfirm 审核
     * @return 结果
     */
    @Override
    public int updateOaConfirm(OaConfirm oaConfirm)
    {
        return oaConfirmMapper.updateOaConfirm(oaConfirm);
    }

    public int commonConfirm(OaConfirm oaConfirm)
    {
        oaConfirm.setConfirmDt( DateUtils.getNowDate() );
        oaConfirm.setFkConfirmUserId( String.valueOf( SecurityUtils.getUserId() ));
        return oaConfirmMapper.commonConfirm(oaConfirm);
    }

    /**
     * 批量删除审核
     * 
     * @param confirmUuids 需要删除的审核主键
     * @return 结果
     */
    @Override
    public int deleteOaConfirmByConfirmUuids(String[] confirmUuids)
    {
        return oaConfirmMapper.deleteOaConfirmByConfirmUuids(confirmUuids);
    }

    /**
     * 删除审核信息
     * 
     * @param confirmUuid 审核主键
     * @return 结果
     */
    @Override
    public int deleteOaConfirmByConfirmUuid(String confirmUuid)
    {
        return oaConfirmMapper.deleteOaConfirmByConfirmUuid(confirmUuid);
    }
}
